/* src/assets/chat.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.chat-bg {
    background: var(--primary-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: var(--text-light);
}

.app-container {
    max-width: 1200px;
    min-width: 60vw;
    height: 90vh;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    height: 70px;
    background: var(--bg-glass-dark);
    border-bottom: 1px solid var(--border-light);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-icon {
    background: var(--primary-gradient);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-glass);
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.9rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.btn {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 8px 16px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--primary-light);
    border: none;
    box-shadow: 0 4px 15px rgba(37, 117, 252, 0.3);
}

.btn-danger {
    background: #ff4d4f;
    border: none;
}

.app-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    background: var(--bg-glass);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 20px 20px 10px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.online-count {
    background: var(--accent-color);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
}

.user-search {
    margin-bottom: 15px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 15px 10px 35px;
    border-radius: 50px;
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
    outline: none;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.7;
}

.user-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.user-item:hover {
    background: var(--bg-glass-dark);
}

.user-item.active {
    background: rgba(106, 17, 203, 0.3);
    box-shadow: 0 4px 12px rgba(106, 17, 203, 0.2);
}

.user-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    /* width: 4px; */
    /* background: var(--accent-color); */
}

.user-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 12px;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 500;
    margin-bottom: 3px;
}

.user-status {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-online {
    background: #4caf50;
}

.status-offline {
    background: #9e9e9e;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 15px 25px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    background: var(--bg-glass-dark);
}

.current-chat-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.message-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    /*background: url('');*/
}

.message {
    max-width: 75%;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 18px;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.sent {
    align-self: flex-end;
    background: var(--primary-gradient);
    border-bottom-right-radius: 5px;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 117, 252, 0.3);
}

.message.received {
    align-self: flex-start;
    background: var(--bg-glass);
    border-bottom-left-radius: 5px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-top: 5px;
    text-align: right;
}

.message-input-area {
    padding: 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-glass-dark);
}

.input-container {
    display: flex;
    gap: 12px;
}

.input-container input {
    flex: 1;
    padding: 12px 18px;
    border-radius: 50px;
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    outline: none;
}

.input-container input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.send-button {
    background: var(--primary-gradient) !important;
    border: none !important;
    transition: all 0.3s ease !important;
    padding: 12px 24px;
    border-radius: 50px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(37, 117, 252, 0.3);
}

.send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 117, 252, 0.4) !important;
}

.empty-chat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: 30px;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-text {
    font-size: 1.2rem;
    opacity: 0.7;
    margin-bottom: 30px;
    max-width: 400px;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    font-size: 0.85rem;
    opacity: 0.7;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-light);
    border-radius: 50%;
    animation: bounce 1.5s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: rgba(40, 40, 60, 0.95);
    padding: 30px;
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body{
        padding: 0;
    }

    .chat-bg{
        padding: 0;
    }

    .app-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .header-left{
        display: none;
    }

    .sidebar{

    }

    .user-item {
        justify-content: center;
        padding: 15px 5px;
    }

    .sidebar{
        backdrop-filter: blur(9px);
        background: rgb(68 93 208 / 82%);
    }

    .message {
        max-width: 85%;
    }

    .input-container{
        height: 40px;
    }

    .input-container input{
        min-width: 90px;
    }

    .message-input-area{
        padding: 10px;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 12px;
    background: rgba(30, 30, 50, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 100;
    animation: slideIn 0.3s ease-out, fadeOut 0.3s ease-out 2.7s;
    max-width: 300px;
}

@keyframes slideIn {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
